package com.example.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @author 紫煦桉
 */
public class NewspaperMessage extends AbstractToString {
    private Integer newsNo;
    private String newsName;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date newsDate;
    private AreaMessage areaMessage;

    public NewspaperMessage() {
    }

    public NewspaperMessage(Integer newsNo) {
        this.newsNo = newsNo;
    }

    public NewspaperMessage(Integer newsNo, String newsName, Date newsDate) {
        this.newsNo = newsNo;
        this.newsName = newsName;
        this.newsDate = newsDate;
    }

    public NewspaperMessage(Integer newsNo, String newsName, Date newsDate, AreaMessage areaMessage) {
        this.newsNo = newsNo;
        this.newsName = newsName;
        this.newsDate = newsDate;
        this.areaMessage = areaMessage;
    }

    public Integer getNewsNo() {
        return newsNo;
    }

    public void setNewsNo(Integer newsNo) {
        this.newsNo = newsNo;
    }

    public String getNewsName() {
        return newsName;
    }

    public void setNewsName(String newsName) {
        this.newsName = newsName;
    }

    public Date getNewsDate() {
        return newsDate;
    }

    public void setNewsDate(Date newsDate) {
        this.newsDate = newsDate;
    }

    public AreaMessage getAreaMessage() {
        return areaMessage;
    }

    public void setAreaMessage(AreaMessage areaMessage) {
        this.areaMessage = areaMessage;
    }
}
